<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <title>风控统计</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon"/>
    <!-- 当前页面样式 -->
    <link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
    <!-- 当前页面样式 END -->
    <script type="text/javascript" src="<c:url value="/js/jquery-1.3.2.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
    <script type="text/javascript">
    	function backToSelect(){
    		window.location.href=window.location.href="<%=basePath%>/windControllSta/headRouteJsp.ct";
    	}
    	
    	function checkSubmit(){
    		//默认寸头 defaultHead
    		var defaultHead = $.trim($("#defaultHead").val());
    		if(!defaultHead){
    			alert("默认头寸值不能为空");
    			return false;
    		}
    		
    		if(!(/^\d+(\.{0,1}\d+){0,1}$/.test(defaultHead))){
    			alert("默认头寸值只能为非负实数");
    			return false;
    		}
    		
    		var avaliableHeadAdd = $.trim($("#avaliableHeadAdd").val());
    		if(!avaliableHeadAdd){
    			alert("可用头寸增加值不能为空");
    			return false;
    		}
    		
    		if(!( /^-?\d+\.?\d*$/.test(avaliableHeadAdd))){
    			alert("可用增加值输入不合法！");
    			return false;
    		}
    		
    		var resver1 = $.trim($("#resver1").val());
    		if(!resver1){
    			alert("最小代付金额不能为空！");
    			return false;
    		}
    		
    		if(!(/^\d+(\.{0,1}\d+){0,1}$/).test(resver1)){
    			alert("最小代付金额输入不合法！");
    			return false;
    		}
    		
    		var resver2 = $.trim($("#resver2").val());
    		if(!resver2){
    			alert("最大代付金额不能为空！");
    			return false;
    		}
    		
    		if(!(/^\d+(\.{0,1}\d+){0,1}$/.test(resver2))){
    			alert("最大代付金额输入不合法！");
    			return false;
    		}
    		
    		var resver3 = $.trim($("#resver3").val());
    		var resver4 = $.trim($("#resver4").val());
    		if(!resver3 || !resver4){
    			alert("代付通道生效时间不能为空");
    			return false;
    		}
    		$("#updateHeadRouteForm").attr("action","<%=basePath%>/windControllSta/modifyHeadRoute.ct");
			$("#updateHeadRouteForm").submit();
    	}
	</script>
</head>
<body>
<s:form id="updateHeadRouteForm" action="" method="post" theme="simple">
	<s:textfield id="insCdPre" name="someRoute.insCdPre" type="hidden" />
	<s:textfield id="procCd" name="someRoute.procCd" type="hidden"/>
	<s:textfield id="routeInsCd" name="someRoute.routeInsCd" type="hidden"/>
	
<table class="tb">
    <tbody>
        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
        </tr>

        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h3">修改头寸信息</div></td>
        </tr>
		<tr class="tb-line">
			
			<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">默认头寸(元)：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal"><s:textfield id="defaultHead" name="someRoute.defaultHead" cssClass="queryWidth" /></label>
            </td>
            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">可用头寸值(元)：</div>
            </td>
            <td class="tb-td">
            	初始值：<label class="tb-input-mini"><s:textfield id="avaliableHead" name="someRoute.avaliableHead" />
                </label>增值：<label class="tb-input-mini"><s:textfield id="avaliableHeadAdd" name="someRoute.avaliableHeadAdd"/></label>
            </td>
		</tr>
		<tr class="tb-line">
			<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">最小代付金额(元)：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal"><s:textfield id="resver1" name="someRoute.resver1" cssClass="queryWidth" /></label>
            </td>
            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">最大代付金额(元)：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal"><s:textfield id="resver2" name="someRoute.resver2" cssClass="queryWidth" /></label>
            </td>
		</tr>
        <tr class="tb-line">
        	<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">代付通道生效时间：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-mini"><s:textfield id="resver3"  name="someRoute.resver3" 
                onfocus="WdatePicker({dateFmt:'HHmm',readOnly:true,wdate:true,errDealMode:0});" 
                /></label>-<label class="tb-input-mini"><s:textfield id="resver4"  name="someRoute.resver4" 
                onfocus="WdatePicker({dateFmt:'HHmm',readOnly:true,wdate:true,errDealMode:0});" 
                /></label><code class="asterisk">*</code>
            </td>
         </tr>
         
         
          

        <tr class="tb-line">
            <td class="tb-td line-submit" align="right" colspan="4">
                <label class="tb-input-submit">
                    <input type="button" value="保   存" onclick="return checkSubmit();"/>
                </label>
                <label class="tb-input-submit">
                    <input type="button" value="返   回" onclick="return backToSelect();"/>
                </label>
            </td>
        </tr>
    </tbody>
    
</table>

</s:form>

<s:if test="#request.msg == true">
		<script language="javascript">
			alert("操作成功！");
			window.location.href="<%=basePath%>/windControllSta/headRouteJsp.ct";
		</script>
</s:if>
<s:if test="#request.msg == false">
	<script language="javascript">
			alert("操作失败！");
	</script>
</s:if>
</body>
</html>